package Operation;
import Book.Book;
import Book.BookList;

import java.util.Scanner;

public class Addoperation implements Interface{
    @Override
    public void work(BookList bookList) {
            System.out.println("输入你想要增加的书名：");
            Scanner scanner=new Scanner(System.in);
            String AddName=scanner.nextLine();
            System.out.println("输入你想要增加的书的作者：");
            String AddAuthor=scanner.nextLine();
            System.out.println("输入你想要增加的书的类型：");
            String AddType=scanner.nextLine();
            System.out.println("输入你想要增加的书的价格：");
            int AddPric=scanner.nextInt();
            Book book=new Book(AddName,AddAuthor,AddType,AddPric);
            int Quantity=bookList.getQuantity();
            bookList.Add(book,Quantity);
            bookList.setQuantity(Quantity+1);
            System.out.println("增加成功");
    }
}
